Replace most uses of <Primary> with <Control>
authorMatthias Clasen <mclasen@redhat.com>
Mon, 6 Apr 2020 21:05:52 +0000 (17:05 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 6 Apr 2020 21:05:52 +0000 (17:05 -0400)
The only place where we are still using <Primary> is
in tests, to ensure we keep parsing it. Otherwise,
<Control> is now the preferred syntax.

demos/gtk-demo/appmenu.ui
demos/gtk-demo/demo.ui
demos/gtk-demo/menus.ui
demos/widget-factory/help-overlay.ui
demos/widget-factory/widget-factory.c
examples/bp/bloatpad.c
gtk/gtkapplication-quartz.c
gtk/gtkapplication.c

index 5eb87c640de098c4df5bed1c790ce2e0556aad25..4b65b186e4c7f353cf65fef77ccebc296180e7d4 100644 (file)
@@ -11,7 +11,7 @@
       <item>
         <attribute name="label" translatable="yes">_Quit</attribute>
         <attribute name="action">app.quit</attribute>
-        <attribute name="accel">&lt;Primary&gt;q</attribute>
+        <attribute name="accel">&lt;Control&gt;q</attribute>
       </item>
     </section>
   </menu>
index bc829396f59e81a7ed4c860d594e0362635cb96e..f4cda560771d1e298a21e633776a1afe26e709b7 100644 (file)
         <item>
           <attribute name="label" translatable="yes">_New</attribute>
           <attribute name="action">win.new</attribute>
-          <attribute name="accel">&lt;Primary&gt;n</attribute>
+          <attribute name="accel">&lt;Control&gt;n</attribute>
         </item>
         <item>
           <attribute name="label" translatable="yes">_Open</attribute>
           <attribute name="action">win.open</attribute>
-          <attribute name="accel">&lt;Primary&gt;o</attribute>
+          <attribute name="accel">&lt;Control&gt;o</attribute>
         </item>
         <item>
           <attribute name="label" translatable="yes">_Save</attribute>
           <attribute name="action">win.save</attribute>
-          <attribute name="accel">&lt;Primary&gt;s</attribute>
+          <attribute name="accel">&lt;Control&gt;s</attribute>
         </item>
         <item>
           <attribute name="label" translatable="yes">Save _As</attribute>
           <attribute name="action">win.save-as</attribute>
-          <attribute name="accel">&lt;Primary&gt;q</attribute>
+          <attribute name="accel">&lt;Control&gt;q</attribute>
         </item>
       </section>
       <section>
         <item>
           <attribute name="label" translatable="yes">_Quit</attribute>
           <attribute name="action">win.quit</attribute>
-          <attribute name="accel">&lt;Primary&gt;&lt;Shift&gt;s</attribute>
+          <attribute name="accel">&lt;Control&gt;&lt;Shift&gt;s</attribute>
         </item>
       </section>
     </submenu>
         <item>
           <attribute name="label" translatable="yes">_Copy</attribute>
           <attribute name="action">win.copy</attribute>
-          <attribute name="accel">&lt;Primary&gt;c</attribute>
+          <attribute name="accel">&lt;Control&gt;c</attribute>
         </item>
         <item>
           <attribute name="label" translatable="yes">_Cut</attribute>
           <attribute name="action">win.cut</attribute>
-          <attribute name="accel">&lt;Primary&gt;x</attribute>
+          <attribute name="accel">&lt;Control&gt;x</attribute>
         </item>
         <item>
           <attribute name="label" translatable="yes">_Paste</attribute>
           <attribute name="action">win.paste</attribute>
-          <attribute name="accel">&lt;Primary&gt;v</attribute>
+          <attribute name="accel">&lt;Control&gt;v</attribute>
         </item>
       </section>
     </submenu>
index d9572b9f39166b3af076ce0bc730c0445000affd..0fe4bd946adcf60c4191a7d9dcba81016bc8d870 100644 (file)
@@ -5,7 +5,7 @@
       <item>
         <attribute name="label" translatable="yes">_New</attribute>
         <attribute name="action">app.new</attribute>
-        <attribute name="accel">&lt;Primary&gt;n</attribute>
+        <attribute name="accel">&lt;Control&gt;n</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">_Open</attribute>
       <item>
         <attribute name="label" translatable="yes">_Save</attribute>
         <attribute name="action">app.save</attribute>
-        <attribute name="accel">&lt;Primary&gt;s</attribute>
+        <attribute name="accel">&lt;Control&gt;s</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">Save _As...</attribute>
         <attribute name="action">app.save-as</attribute>
-        <attribute name="accel">&lt;Primary&gt;s</attribute>
+        <attribute name="accel">&lt;Control&gt;s</attribute>
       </item>
     </section>
     <section>
       <item>
         <attribute name="label" translatable="yes">_Quit</attribute>
         <attribute name="action">app.quit</attribute>
-        <attribute name="accel">&lt;Primary&gt;q</attribute>
+        <attribute name="accel">&lt;Control&gt;q</attribute>
       </item>
     </section>
   </menu>
               <attribute name="label" translatable="yes">_Red</attribute>
               <attribute name="action">app.color</attribute>
               <attribute name="target">red</attribute>
-              <attribute name="accel">&lt;Primary&gt;r</attribute>
+              <attribute name="accel">&lt;Control&gt;r</attribute>
             </item>
             <item>
               <attribute name="label" translatable="yes">_Green</attribute>
               <attribute name="action">app.color</attribute>
               <attribute name="target">green</attribute>
-              <attribute name="accel">&lt;Primary&gt;g</attribute>
+              <attribute name="accel">&lt;Control&gt;g</attribute>
             </item>
             <item>
               <attribute name="label" translatable="yes">_Blue</attribute>
               <attribute name="action">app.color</attribute>
               <attribute name="target">blue</attribute>
-              <attribute name="accel">&lt;Primary&gt;b</attribute>
+              <attribute name="accel">&lt;Control&gt;b</attribute>
             </item>
           </section>
         </submenu>
               <attribute name="label" translatable="yes">_Square</attribute>
               <attribute name="action">win.shape</attribute>
               <attribute name="target">square</attribute>
-              <attribute name="accel">&lt;Primary&gt;s</attribute>
+              <attribute name="accel">&lt;Control&gt;s</attribute>
             </item>
             <item>
               <attribute name="label" translatable="yes">_Rectangle</attribute>
               <attribute name="action">win.shape</attribute>
               <attribute name="target">rectangle</attribute>
-              <attribute name="accel">&lt;Primary&gt;r</attribute>
+              <attribute name="accel">&lt;Control&gt;r</attribute>
             </item>
             <item>
               <attribute name="label" translatable="yes">_Oval</attribute>
               <attribute name="action">win.shape</attribute>
               <attribute name="target">oval</attribute>
-              <attribute name="accel">&lt;Primary&gt;o</attribute>
+              <attribute name="accel">&lt;Control&gt;o</attribute>
             </item>
           </section>
         </submenu>
         <item>
           <attribute name="label" translatable="yes">_Bold</attribute>
           <attribute name="action">win.bold</attribute>
-          <attribute name="accel">&lt;Primary&gt;&lt;Shift&gt;b</attribute>
+          <attribute name="accel">&lt;Control&gt;&lt;Shift&gt;b</attribute>
         </item>
       </section>
     </submenu>
@@ -96,7 +96,7 @@
       <item>
         <attribute name="label" translatable="yes">_About</attribute>
         <attribute name="action">win.about</attribute>
-        <attribute name="accel">&lt;Primary&gt;a</attribute>
+        <attribute name="accel">&lt;Control&gt;a</attribute>
       </item>
     </submenu>
   </menu>
index 0e4bbff1f7c523ff17784b75a8ad8c85eb27f242..e751fdb6df82d85798dc55512ec1843c25667ff7 100644 (file)
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="accelerator">&lt;Primary&gt;q</property>
+                <property name="accelerator">&lt;Control&gt;q</property>
                 <property name="title">Quit</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="accelerator">&lt;Primary&gt;d</property>
+                <property name="accelerator">&lt;Control&gt;d</property>
                 <property name="title">Switch to dark theme</property>
               </object>
             </child>
@@ -31,7 +31,7 @@
             <property name="view">page2</property>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="accelerator">&lt;Primary&gt;s</property>
+                <property name="accelerator">&lt;Control&gt;s</property>
                 <property name="title">Search</property>
               </object>
             </child>
@@ -43,7 +43,7 @@
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="accelerator">&lt;Primary&gt;b</property>
+                <property name="accelerator">&lt;Control&gt;b</property>
                 <property name="title">Set background</property>
               </object>
             </child>
             <property name="view">page3</property>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="accelerator">&lt;Primary&gt;o</property>
+                <property name="accelerator">&lt;Control&gt;o</property>
                 <property name="title">Open a file</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="accelerator">&lt;Primary&gt;r</property>
+                <property name="accelerator">&lt;Control&gt;r</property>
                 <property name="title">Start recording</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="accelerator">&lt;Primary&gt;l</property>
+                <property name="accelerator">&lt;Control&gt;l</property>
                 <property name="title">Lock or unlock</property>
               </object>
             </child>
index 9dd12e62c93f9381b700f99d674228466dbb5a0c..0d78b1bb89e496a586ce89c206b7fe0ee27dc445 100644 (file)
@@ -1738,18 +1738,18 @@ activate (GApplication *app)
     const gchar *accelerators[2];
   } accels[] = {
     { "app.about", { "F1", NULL } },
-    { "app.quit", { "<Primary>q", NULL } },
-    { "app.open-in", { "<Primary>n", NULL } },
-    { "app.cut", { "<Primary>x", NULL } },
-    { "app.copy", { "<Primary>c", NULL } },
-    { "app.paste", { "<Primary>v", NULL } },
-    { "win.dark", { "<Primary>d", NULL } },
-    { "win.search", { "<Primary>s", NULL } },
+    { "app.quit", { "<Control>q", NULL } },
+    { "app.open-in", { "<Control>n", NULL } },
+    { "app.cut", { "<Control>x", NULL } },
+    { "app.copy", { "<Control>c", NULL } },
+    { "app.paste", { "<Control>v", NULL } },
+    { "win.dark", { "<Control>d", NULL } },
+    { "win.search", { "<Control>s", NULL } },
     { "win.delete", { "Delete", NULL } },
-    { "win.background", { "<Primary>b", NULL } },
-    { "win.open", { "<Primary>o", NULL } },
-    { "win.record", { "<Primary>r", NULL } },
-    { "win.lock", { "<Primary>l", NULL } },
+    { "win.background", { "<Control>b", NULL } },
+    { "win.open", { "<Control>o", NULL } },
+    { "win.record", { "<Control>r", NULL } },
+    { "win.lock", { "<Control>l", NULL } },
   };
   gint i;
   GPermission *permission;
index fcbca05484b232a3662fb031721eb1c721c77ba2..f8f48d4fc96d0111bf2c8b3b9fc65994aca77463 100644 (file)
@@ -517,13 +517,13 @@ bloat_pad_startup (GApplication *application)
     const gchar *action_and_target;
     const gchar *accelerators[2];
   } accels[] = {
-    { "app.new", { "<Primary>n", NULL } },
-    { "app.quit", { "<Primary>q", NULL } },
-    { "win.copy", { "<Primary>c", NULL } },
-    { "win.paste", { "<Primary>p", NULL } },
-    { "win.justify::left", { "<Primary>l", NULL } },
-    { "win.justify::center", { "<Primary>m", NULL } },
-    { "win.justify::right", { "<Primary>r", NULL } }
+    { "app.new", { "<Control>n", NULL } },
+    { "app.quit", { "<Control>q", NULL } },
+    { "win.copy", { "<Control>c", NULL } },
+    { "win.paste", { "<Control>p", NULL } },
+    { "win.justify::left", { "<Control>l", NULL } },
+    { "win.justify::center", { "<Control>m", NULL } },
+    { "win.justify::right", { "<Control>r", NULL } }
   };
 
   G_APPLICATION_CLASS (bloat_pad_parent_class)
@@ -592,7 +592,7 @@ bloat_pad_startup (GApplication *application)
   g_object_unref (item);
   g_object_unref (icon);
 
-  const gchar *new_accels[] = { "<Primary>n", "<Primary>t", NULL };
+  const gchar *new_accels[] = { "<Control>n", "<Control>t", NULL };
   gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new", new_accels);
 
   dump_accels (GTK_APPLICATION (application));
index 55f51e6a89a9becd2b0c60dc2ee7f11e3be5dd27..38131f4be00bbfd75cd4d220451a21c714220fb9 100644 (file)
@@ -124,10 +124,10 @@ gtk_application_impl_quartz_startup (GtkApplicationImpl *impl,
   GtkApplicationImplQuartz *quartz = (GtkApplicationImplQuartz *) impl;
   GSimpleActionGroup *gtkinternal;
   GMenuModel *app_menu;
-  const gchar *pref_accel[] = {"<Primary>comma", NULL};
-  const gchar *hide_others_accel[] = {"<Primary><Alt>h", NULL};
-  const gchar *hide_accel[] = {"<Primary>h", NULL};
-  const gchar *quit_accel[] = {"<Primary>q", NULL};
+  const gchar *pref_accel[] = {"<Control>comma", NULL};
+  const gchar *hide_others_accel[] = {"<Control><Alt>h", NULL};
+  const gchar *hide_accel[] = {"<Control>h", NULL};
+  const gchar *quit_accel[] = {"<Control>q", NULL};
 
   if (register_session)
     {
index b9bc8f460a0efaa8741d1a8b776ce4df1141b43e..2f4a3ceaf27ec2cc0f57415e1dbabf1aaaeb14d4 100644 (file)
@@ -278,7 +278,7 @@ gtk_application_load_resources (GtkApplication *application)
     path = g_strconcat (base_path, "/gtk/help-overlay.ui", NULL);
     if (g_resources_get_info (path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
       {
-        const gchar * const accels[] = { "<Primary>question", NULL };
+        const gchar * const accels[] = { "<Control>question", NULL };
 
         priv->help_overlay_path = path;
         gtk_application_set_accels_for_action (application, "win.show-help-overlay", accels);